This invention relates generally to uses of mark-up language and, more particularly, to a method and system for representing a high-level programming language data structure in a mark-up language.
There are currently a myriad of high-level programming languages available for a programmer to use. Some of the more popular ones include JAVA, JAVA Script and C++. Each high-level languages has its own way of defining data structures, such as arrays, integers, strings, and the like. However, a data structure written in the source code of one language generally cannot be compiled by a compiler of a different language. Thus, if a programmer is working on a system in which two or more different programming languages are being used, but all require access to the same data structure, then he or she is forced to write the data structure in each applicable language. This is particularly cumbersome when the data structure needs to be changed during the debugging process.
In accordance with the foregoing, a novel method and system for representing a high-level programming language data structure in a mark-up language is provided. According to the method, each variable of data structure is represented as a mark-up language element. The nesting of the elements represents the hierarchical relationship among the variables. Each element includes the name of the variable represented by the element and the type of the variable. The variable name may be included as the tag name, and the variable type may be included as an attribute. Additionally, a default value may be included as an attribute. Finally, comments to be included in the resulting high-level language source code may be represented in the body of the element.